<template>
	<view class="app-main full-page">
		<Home v-if="currPageNameRef == 'home'" />
		<User v-if="currPageNameRef == 'user'" />
		<ln-tabBar :currPageName="currPageNameRef"
			:navList="navListRef"
			@change="tabBarChange"
		/>
	</view>
</template>

<script setup>
import { ref, reactive, onMounted,markRaw } from 'vue'
import { onLaunch, onLoad } from "@dcloudio/uni-app"
import Home from './components/pages/home/index.vue'
import User from './components/pages/user/index.vue'

const currPageNameRef = ref("home")
const navListRef = ref([])

navListRef.value = [
	{
		"name": "home",
		"iconPath": "ln-home",
		"text": "主页",
		"pageIndex": 1
	},
	{
		"name": "record",
		"iconPath": "ln-jiahao",
		"text": "记录",
		"pageIndex": 2
	},
	{
		"name": "user",
		"iconPath": "ln-user",
		"text": "用户",
		"pageIndex": 3
	}
]

function tabBarChange(tab) {
	currPageNameRef.value = tab.name
}
</script>

<style lang="less">
	.app-main {
		box-sizing: border-box;
	}
</style>